package com.yanyeori.springaop;

import com.yanyeori.springaop.service.CalculatorService;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author chenkuan
 * @desc
 * @date 2021/3/10 010 18:44
 */
public class AopTest1 {

    private ApplicationContext ioc;

    @Before
    public void before() {
        ioc = new ClassPathXmlApplicationContext("spring-aop.xml");
    }

    @Test
    public void test1() {
        CalculatorService bean = ioc.getBean(CalculatorService.class);
        System.out.println(bean.getClass());
        bean.add(1, 1);
    }
}
